/**
 * 使用类类型
 * */

function create<Type>(c: { new(): Type }): Type {
  return new c()
}

class BeeKeeper {
  hasMask: boolean = true
}

class zooKeeper {
  nametag: string = 'Mikle'
}

class Animal {
  numLegs: number = 4
}

class Bee extends Animal {
  keeper: BeeKeeper = new BeeKeeper()
}

class Lion extends Animal {
  keeper: zooKeeper = new zooKeeper()
}

function createInstance<A extends Animal>(c: new () => A): A {
  return new c();
}